package com.cleaningcloud.cld.controller.mini;

import com.cleaningcloud.cld.domain.vo.CldTrainPlanVo;
import com.cleaningcloud.cld.service.mini.IMiniTrainPlanService;
import com.cleaningcloud.common.core.web.controller.BaseController;
import com.cleaningcloud.common.core.web.domain.AjaxResult;
import com.cleaningcloud.common.core.web.page.TableDataInfo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * packageName com.cleaningcloud.cld.controller.mini
 *
 * @author Shaw
 * @version JDK 8
 * @className MiniTrainPlanController
 * @date 2025-06-12
 * @description 小程序-培训计划
 */
@RestController
@RequestMapping("/mini/trainPlan")
public class MiniTrainPlanController extends BaseController {

    @Autowired
    private IMiniTrainPlanService miniTrainPlanService;

    /**
     * @Author Shaw
     * @Description 小程序(客户端)-查看培训计划列表
     * @date: 2025-06-12 16:27
     * @param: //TODO
     */
    @Operation(description = "获取培训计划列表")
    @GetMapping("/getTrainPlanList")
    public TableDataInfo getTrainPlanList(CldTrainPlanVo cldTrainPlanVo){
        startPage();
        return getMiniDataTable(miniTrainPlanService.getCustomerWorkPlanInfo(cldTrainPlanVo));
    }

    /**
     * @Author Shaw
     * @Description 小程序(客户端)-获取培训计划详情
     * @date: 2025-06-12 16:27
     * @param: //TODO
     */
    @Operation(description = "获取培训计划详情")
    @GetMapping("/getTrainPlanInfo/{trainPlanId}")
    public AjaxResult getTrainPlanInfo(@PathVariable Long trainPlanId){
        return success(miniTrainPlanService.getTrainPlanInfo(trainPlanId));
    }
}